home *** CD-ROM | disk | FTP | other *** search
-
- package sub_arctic.constraints;
-
- /**
- * A small class to encapsulate a <value_provider, part_number> pair.
- *
- * @author Scott Hudson
- */
- public class provider_part_ref {
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /** The provider object. */
- public value_provider obj;
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /** The part number of that object that we refer to */
- public int part_num;
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Constructor.
- *
- * @param value_provider o the object providing the value.
- * @param int pn the number of the part within the object which
- * provides the value.
- */
- public provider_part_ref(value_provider o, int pn)
- {
- obj = o;
- part_num = pn;
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /** Hash code so we can put these in hash tables. */
- public int hashCode()
- {
- return obj.hashCode() ^ part_num;
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /** Comparison operator. */
- public boolean equals(Object other)
- {
- provider_part_ref other_one;
-
- /* not equal to anything of the wrong type */
- if (!(other instanceof provider_part_ref)) return false;
-
- /* convert and test */
- other_one = (provider_part_ref)other;
- return other_one.obj == obj && other_one.part_num == part_num;
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
- }
-
- /*=========================== COPYRIGHT NOTICE ===========================
-
- This file is part of the subArctic user interface toolkit.
-
- Copyright (c) 1996 Scott Hudson and Ian Smith
- All rights reserved.
-
- The subArctic system is freely available for most uses under the terms
- and conditions described in
- http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html
- and appearing in full in the lib/interactor.java source file.
-
- The current release and additional information about this software can be
- found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
-
- ========================================================================*/
-